/*
  Jeff Eaton, 2014
  This example demonstrates the use of the BPK000 device / library to make "Hello World" appear randomly on a 4x20 LCD
  
  I used the SendOnlySoftwareSerial library (modified version of the standard SoftwareSerial library)
  Available here: http://gammon.com.au/Arduino/SendOnlySoftwareSerial.zip
  
*/

#include "BPK000.h" // include the library header file
#include "SendOnlySoftwareSerial.h"

int lcdSerialPin = 3;
int baudRate = 9600; // will either be 9600 or 2400 depending on the state of the BPS switch on the device
int row;
int col;

BPK000 lcd = BPK000(lcdSerialPin, baudRate); // initialize the BPK000 class
// the actual serial connection is initialized within the library so no lcd.begin() call is needed

void setup() {
  randomSeed(analogRead(0)); // seed the random number generator with an analog reading of an unconnected pin
}

void loop() {
  lcd.clear(); // clear the screen
  row = random(0,4); // 0 through 3
  col = random(0,10); // 0 through 9
  lcd.setPosition(row,col); // set the write position on screen
  lcd.print("Hello World"); // print hello world
  delay(2000); // wait two seconds
}
